package com.funcpro.common.utils;

import cn.hutool.crypto.SecureUtil;
import org.apache.commons.lang3.StringUtils;

import java.nio.charset.StandardCharsets;

/**
 * @author ZYT
 * @desc
 * @time 2023-11-08 14:02
 */
public class AesUtils {
    private static final byte[] KEYS="12345678abcdefgh".getBytes(StandardCharsets.UTF_8);

    public static String decrypt(String value){
        if (StringUtils.isBlank(value)){
            return null;
        }
        return SecureUtil.aes(KEYS).decryptStr(value);
    }

    public static String encryptHex(String value){
        if (StringUtils.isBlank(value)){
            return null;
        }
        return SecureUtil.aes(KEYS).encryptHex(value);
    }

}
